list = [1, 3, 5, 6, 10]
current = []
for i in range(len(list)):
    if len(list) == 1:
        print(list[i])
        break
    elif i == (len(list)-1):
        current.append(int(list[i-1]) + int(list[0]))
        break
    current.append(int(list[i-1])+int(list[i+1]))
    i += 1

for x in current:
    print(x, end=' ')




'''for i in range(len(list)):
    if  len(list) > 1:
        current = current.append[(int(list[i+1])+int(list[i-1]))]
        i += 1
    elif i == len(list)-1:
        print (int(list[0]) + int(list[-1]))
    else:
        print (list[i])
print (current)'''
















'''list = [1, 3, 5, 6, 10]
index = 0
first = list[1] + list[-1]
and_code =  list[0] + list[-2]
current = []
while index < len(list):
    current.append((list[index] + list[index+2]))
    #print (s[index+2], '>>>', (index))
    index += 1
print (current)
print (index)'''